home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir31 / tnypla.zip / TEST.C < prev   
C/C++ Source or Header  |  1994-04-06  |  812b  |  35 lines

  1. /* test.c - program test */
  2.  
  3. #include <stdio.h>
  4. #include <malloc.h>
  5. #include "modplay.h"
  6.  
  7. int main()
  8. {
  9.     FILE *handle;
  10.     void *modfile;
  11.     unsigned modsize;
  12.  
  13.     if ((handle = fopen("test.mod","rb")) != NULL) {
  14.         fseek(handle,0L,SEEK_END);
  15.         modsize = ftell(handle);
  16.         fseek(handle,0L,SEEK_SET);
  17.         modfile = (void *) malloc(modsize);
  18.         fread(modfile,modsize,1,handle);
  19.         fclose(handle);
  20.         if (MODPlayModule(modfile,22000,0x220,7,1))
  21.             printf("Error initializing the MOD player.\n");
  22.         else {
  23.             printf("Playing... any key to stop.\n");
  24.             getch();
  25.             MODStopModule();
  26.         }
  27.         free(modfile);
  28.     }
  29.     else {
  30.         printf("Error loading modulefile.\n");
  31.     }
  32.     return 0;
  33. }
  34.  
  35.